% V20210224 - 10.13 GW_MODIFY and GW_AMODIFY Notes zz$ = "not changed" % Initial state. INCLUDE "GW.bas" % Page 1 creation. page1 = GW_NEW_PAGE() % First page title bar. GW_ADD_TITLEBAR (page1, "first page") % Add a textbox and two buttons. tb = GW_ADD_TEXTBOX(page1, "") GW_ADD_BUTTON(page1, "change state", "change") GW_ADD_BUTTON(page1, "go to page 2", "page 2") % Page 2 creation. page2 = GW_NEW_PAGE() % Second page title bar. GW_ADD_TITLEBAR(page2, "second page") % Add a button. GW_ADD_BUTTON(page2, "go to page 1", "page 1") % Page 1: render and interact with the page. p1: GW_RENDER(page1) % Here we modify page 1. GW_MODIFY(tb, "text", zz$) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Test for the "change state" button. IF r$ = "change" THEN IF zz$ = "changed" THEN zz$ = "not changed" ELSE zz$ = "changed" GW_MODIFY(tb, "text", zz$) ENDIF %Test for the "go to page 2" button. IF r$ = "page 2" THEN GOTO p2 % End when BACK key is pressed. UNTIL r$ = "BACK" END % Page 2: render and interact with the page. p2: GW_RENDER(page2) DO % Wait for user action. r$ = GW_WAIT_ACTION$() %Test for the "go to page 1" button. IF r$ = "page 1" THEN GOTO p1 % End when BACK key is pressed. UNTIL r$ = "BACK" END